home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / guide / html-hea.lha / ARexx / HTML-EdWord5.rexx < prev    next >
OS/2 REXX Batch file  |  1995-05-27  |  1KB  |  36 lines

  1. /* HTML-Helper Arexx script sample
  2.  * Ver      : 1.1 (25th May 1995)
  3.  * Copyright: Paul Kolenbrander (InterNet: paul@serena.iaehv.nl)
  4.  * Function : Pass on the HTML commands from HTML-Helper to EdWord Pro.
  5.  * Author   : Martin Reddy, <mxr@dcs.ed.ac.uk>,
  6.               Simon Dick, <sidick@essex.ac.uk>
  7.  * Input    : HTMLCMD - The HTML command to be inserted.
  8.  */
  9.  
  10. OPTIONS RESULTS                               /* enable return codes */
  11. PARSE ARG HTMLCMD
  12.  
  13. ADDRESS 'EDWORD'                              /* The editor's ARexx port */
  14.  
  15. IF POS('><',HTMLCMD) ~= 0 THEN DO             /* Is it a split command */
  16.    IsSelected
  17.    IF (RESULT = -1) THEN DO
  18.       CMD2 = right(HTMLCMD,(LENGTH(HTMLCMD)-(LASTPOS('<',HTMLCMD))+1))
  19.       CMD1 = substr(HTMLCMD,1,(LENGTH(HTMLCMD)-LENGTH(CMD2)))
  20.       SetView OFF
  21.       SetMark 3
  22.       JumpToBlockStart
  23.       InsertText CMD1
  24.       JumpToBlockEnd
  25.       InsertText CMD2
  26.       JumpToMark 3
  27.       BlockOff
  28.       SetView ON
  29.       END
  30.    ELSE
  31.       InsertText HTMLCMD
  32.    END
  33. ELSE
  34.    InsertText HTMLCMD                         /* the Insert command */
  35. EXIT                                          /* And exit the script.*/
  36.